home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
winter_challenge.swf
/
scripts
/
frame_153
/
PlaceObject2_262_111
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2011-08-19
|
1KB
|
39 lines
onClipEvent(enterFrame){
if(alive == 1)
{
point = new object();
point.x = _root.bossClip.boss.bossInner._x;
point.y = _root.bossClip.boss.bossInner._y;
_root.bossClip.boss.bossInner.localToGlobal(point);
this._x = point.x;
this._y = point.y;
rot = Math.atan2(_root.ATVclip._y - this._y,_root.ATVclip._x - this._x);
rotNum = rot * 360 / 6.283185307179586;
this._rotation = rotNum;
i++;
if(i > 25 + random(100) && _root.gameInProgress == 1 && _root.bossClip.actionFlag == 1)
{
_root.ball._visible = 1;
duplicateMovieClip(_root.doppelBall,"newDoppelBall",16384 + (8000 + i));
var hyp = 35;
_root.newDoppelBall.pathRadius = 35;
_root.newDoppelBall.degrees = rotNum;
with(Math)
{
radians = _root.newDoppelBall.degrees * (PI / 180);
yCoor = hyp * Math.sin(radians);
xCoor = hyp * Math.cos(radians);
}
_root.newDoppelBall._x = this._x + xCoor;
_root.newDoppelBall._y = this._y + yCoor;
_root.newDoppelBall.targetX = _root.ATVclip._x;
_root.newDoppelBall.targetY = _root.ATVclip._y;
_root.newDoppelBall._rotation = this._rotation;
i = 1;
_root.CANNON_F.start(0,0);
this.play();
_root.doppelBall._visible = 0;
}
}
}